#!/usr/bin/env python

from Crypto.Hash import SHA256
from random import Random
import os
import getpass

try:
    print "Enter salt:", 
    salt = raw_input()
    passwd = getpass.getpass("Enter password:")

    salted_passwd = salt + passwd
    hashed_passwd = SHA256.new(salted_passwd).hexdigest()

    print "Password hash:", "%s$%s" % (salt, hashed_passwd)
except:
    print
